package com.itlong.cloud.resource;

import com.itlong.cloud.POJO.VO.sdk.CloudControllerButtonStatusVO;
import com.itlong.cloud.iot.service.server.HuawServerService;
import com.itlong.cloud.iottp.IIotSDKServiceClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <desc>
 *      SDK对接iot业务处理暴露接口实现类
 * <desc/>
 *
 * @createDate 2020/08/05
 */
@RestController
public class IotSDKServiceResource implements IIotSDKServiceClient {

    @Autowired
    private HuawServerService huawServerService;
    /**
     * <desc>
     *      获取按键状态
     * <desc/>
     *
     * @param deviceId
     * @return
     * @author caoshuai
     * @createDate 2020/08/05
     */
    @Override
    @RequestMapping(path = "/iot/sdk/getButtonStatus",method = RequestMethod.POST)
    public CloudControllerButtonStatusVO getButtonStatus(@RequestParam("deviceId") String deviceId) {

        return huawServerService.getButtonStatus(deviceId);
    }
}
